package com.ssl.tensquare.recruit.service;

import com.ssl.tensquare.common.entity.RecruitState;
import com.ssl.tensquare.recruit.dao.RecruitDao;
import com.ssl.tensquare.recruit.pojo.Recruit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 描述：
 *
 * @author ssl
 * @create 2019/07/08 13:29
 */
@Service
public class RecruitService {
    @Autowired
    private RecruitDao recruitDao;

    /**
     * 根据状态查询
     *
     * @param state
     * @return
     */
    public List<Recruit> findTop4ByStateOrderByCreateTimeDesc(String state) {
        return recruitDao.findTop4ByStateOrderByCreateTimeDesc(state);
    }

    /**
     * 查询最新职位列表
     *
     * @return
     */
    public List<Recruit> newList() {
        return recruitDao.findTop12ByStateNotOrderByCreateTimeDesc(RecruitState.close.name());
    }

}
